<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<c:choose>
	<c:when test="${empNames != nul}">
		<h2>Names of employees</h2>
		<p>${fn:escapeXml("#{ db.(Employee.(firstName, lastName)) }")}</p>
		<table class="table table-hover">
			<thead>
				<tr>
					<th>Imie</th>
					<th>Nazwisko</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="emp" items="${empNames}">
					<tr>
						<c:forEach var="struct" items="${emp}">
							<td>
								<c:out value="${struct.key}"/>[<c:out value="${struct.value}" />]
							</td>
						</c:forEach>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</c:when>
	<c:otherwise>
		<p>Sorry no data found ;(</p>
	</c:otherwise>
</c:choose>
